package com.slz3.business.module.afterSaleManagement.aftApplyOrder.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.afterSaleManagement.aftApplyOrder.domain.AftApplyOrder;
import com.slz3.business.module.afterSaleManagement.aftApplyOrder.domain.AftApplyOrderCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class AftApplyOrderResController extends AftApplyOrderResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, AftApplyOrder aftApplyOrder) {
        if (AftApplyOrderResUnsafeValid.add(req, aftApplyOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$AftApplyOrderUpdateLock(req, aftApplyOrder);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, AftApplyOrderCondition aftApplyOrderCondition) {
        if (AftApplyOrderResUnsafeValid.delete(req, aftApplyOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$AftApplyOrderUpdateLock(req, aftApplyOrderCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, AftApplyOrder aftApplyOrder) {
        if (AftApplyOrderResUnsafeValid.modify(req, aftApplyOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$AftApplyOrderUpdateLock(req, aftApplyOrder);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (AftApplyOrderResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return aftApplyOrderResAtomic.info_$AftApplyOrderUpdateLock(req);
        if (AftApplyOrderResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$AftApplyOrderUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (AftApplyOrderResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, AftApplyOrderCondition aftApplyOrderCondition) {
        //
        if (AftApplyOrderResUnsafeValid.auditSubmit(req, aftApplyOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$AftApplyOrderUpdateLock(req, aftApplyOrderCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, AftApplyOrderCondition aftApplyOrderCondition) {
        if (AftApplyOrderResUnsafeValid.audit(req, aftApplyOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$AftApplyOrderUpdateLock(req, aftApplyOrderCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, AftApplyOrderCondition aftApplyOrderCondition) {
        if (AftApplyOrderResUnsafeValid.auditReject(req, aftApplyOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$AftApplyOrderUpdateLock(req, aftApplyOrderCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, AftApplyOrderCondition aftApplyOrderCondition) {
        if (AftApplyOrderResUnsafeValid.usingEnable(req, aftApplyOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$AftApplyOrderUpdateLock(req, aftApplyOrderCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, AftApplyOrderCondition aftApplyOrderCondition) {
        if (AftApplyOrderResUnsafeValid.usingDisable(req, aftApplyOrderCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$AftApplyOrderUpdateLock(req, aftApplyOrderCondition);
        }
    }

    public Mono<ServerResponse> sync(ServerRequest req, AftApplyOrder aftApplyOrder) {
        if (AftApplyOrderResUnsafeValid.sync(req, aftApplyOrder)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.sync_$AftApplyOrderUpdateLock(req, aftApplyOrder);
        }
    }

}
